package {{packageName}}.server.service.impl

import com.firefly.`$`
import com.firefly.annotation.Component
import com.firefly.annotation.Inject
import {{packageName}}.api.dao.ProjectDao
import {{packageName}}.api.model.entity.Project
import {{packageName}}.api.model.vo.ProjectVo
import {{packageName}}.api.service.ProjectService

/**
 * @author Pengtao Qiu
 */
@Component("projectService")
class ProjectServiceImpl : ProjectService {

    @Inject
    private lateinit var projectDao: ProjectDao

    override suspend fun get(id: Long): ProjectVo {
        val project = projectDao.get(id)
        val vo = ProjectVo()
        `$`.javabean.copyBean(project, vo)
        return vo
    }

    override suspend fun insert(project: Project): Long = projectDao.insert(project)

}